package com.decent.web.system.dto;

import com.decent.common.validator.Phone;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author: decent Gjh
 * @date: 2022/10/31/9:27
 * @description:
 */
@Data
@RequiredArgsConstructor
public class PayOrderDTO {
    /**
     * 订单编号
     */
    @NotEmpty(message = "订单uuid不能为空",groups = {Insert.class, Select.class})
    private String orderUuid;
    /**
     * 用户id
     */
    @NotNull(message = "用户id不能为null",groups = {Insert.class, Select.class})
    private Integer userId;

    /**
     * 手机号
     */
    @Phone(message = "手机号码不能验证失败",groups = {Insert.class})
    private String phone;

    public PayOrderDTO(String orderUuid, Integer userId) {
        this.orderUuid = orderUuid;
        this.userId = userId;
    }
}
